<?php $this->context->layout = 'fullout'; ?>
<?= \common\widgets\Asset::widget(['type'=>['viewer']])?>
<div style="display: flex">
    <?=$this->params['leftHtml']?>
    <div  style="width: 89.7%">
        <div class="ui-layout-center">
            <div class="container-div">
                <div class="row">
                    <div class="col-sm-12 search-collapse">
                        <form id="role-form">
                            <div class="select-list">
                                <ul>
                                    <li><?= \common\widgets\FormInput::widget(['name'=>'input|名称','extend'=>['name'=>'like[name]']])?></li>
                                    <li><?= \common\widgets\FormInput::widget(['name'=>'select|状态','extend'=>['name'=>'where[status]','value'=>'','place'=>'所有']])?></li>
                                    <li>
                                        <?= $this->render('/iframe',['name'=>'searchbtn|搜索'])?>
                                        <?= $this->render('/iframe',['name'=>'resetbtn|重置'])?>
                                    </li>
                                </ul>
                            </div>
                        </form>
                    </div>
                    <div class="btn-group-sm" id="toolbar" role="group">
                        <?= $this->render('/iframe',['name'=>'addbtn'])?>
                        <?= $this->render('/iframe',['name'=>'editbtn'])?>
                    </div>
                    <div class="col-sm-12 select-table table-striped">
                        <table id="bootstrap-table"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<?php $this->beginBlock('script'); ?>
<script>
    getUserList();
    function getUserList() {
        var options = {
            modalName: "分类列表",
            sortName:'sort',
            sortOrder: "desc",
            columns: [
                {field: 'id', title: 'ID', align: 'center', sortable: true,visible: false},
                {field: 'name', align: 'center', title: '名称'},
                {field: 'sort', align: 'center', title: '排序'},
                {
                    title: '状态',
                    field: 'status',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return $.view.statusTools(row,true);
                    }
                },
                {field: 'create_time', title: '创建时间', align: 'center', sortable: true,visible: false},
                {field: 'update_time', title: '更新时间', align: 'center', sortable: true},
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return '<?=$this->render("/iframe",["name"=>"formopbtn","extend"=>["type"=>["edit","delete"],"rowId"=>"row.id"]])?>';
                    }
                }
            ],
        };
        $.table.init(options);
    }
</script>
<?php $this->endBlock(); ?>

